// 模拟数据
const mockData = {
  // 顶部统计数据
  indexData: [
    { name: '今日通话量', value: 2341 },
    { name: '平均通话时长', value: 158 },
    { name: '等待中通话', value: 23 },
    { name: '在线坐席数', value: 156 },
    { name: '客户满意度', value: 98 }
  ],

  // 区域排名数据
  areaRanking: [
    { ranking: 1, area: "广东", nValue: 17580, yValue: 99.5 },
    { ranking: 2, area: "北京", nValue: 17518, yValue: 98.8 },
    { ranking: 3, area: "上海", nValue: 17458, yValue: 99.2 }
  ],

  // 分类统计数据
  categoryStats: [
    { category: "业务咨询", value: 509558 },
    { category: "技术支持", value: 205763 },
    { category: "投诉建议", value: 128960 },
    { category: "其他问题", value: 57280 }
  ],

  // 月度分类数据
  monthlyStats: {
    "业务咨询": [38048, 14064, 27899, 16173, 24985, 31917, 58884, 29880, 28960, 20952, 17278, 26000],
    "技术支持": [15134, 6362, 17132, 14129, 50841, 79957, 110836, 55893, 47402, 37666, 11114, 18323],
    "投诉建议": [10057, 3658, 9528, 7123, 7417, 10420, 16806, 12580, 7267, 6505, 4234, 5409],
    "其他问题": [4360, 1776, 5582, 4279, 11319, 18578, 17506, 24614, 12602, 10096, 4726, 5563]
  },

  // 分类明细数据
  categoryClassifyData: [
    {
      categoryid: "1",
      categoryName: "业务咨询",
      data: [
        { name: "产品介绍", value: 172324 },
        { name: "价格咨询", value: 119331 }
      ]
    },
    {
      categoryid: "2", 
      categoryName: "技术支持",
      data: [
        { name: "系统使用", value: 92345 },
        { name: "功能配置", value: 104781 },
        { name: "故障排除", value: 117193 },
        { name: "升级服务", value: 56870 }
      ]
    },
    {
      categoryid: "3",
      categoryName: "投诉建议",
      data: [
        { name: "服务态度", value: 41921 },
        { name: "响应时间", value: 191627 },
        { name: "处理结果", value: 169267 },
        { name: "服务质量", value: 70267 }
      ]
    },
    {
      categoryid: "4",
      categoryName: "其他问题",
      data: [
        { name: "合作咨询", value: 94868 },
        { name: "其他", value: 115600 }
      ]
    }
  ]
}

// API方法
export function getIndexData() {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve({
        code: 200,
        data: mockData.indexData
      })
    }, 300)
  })
}

export function getAreaRanking() {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve({
        code: 200,
        data: mockData.areaRanking
      })
    }, 300)
  })
}

export function getCategoryStats() {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve({
        code: 200,
        data: mockData.categoryStats
      })
    }, 300)
  })
}

export function getMonthlyStats() {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve({
        code: 200,
        data: mockData.monthlyStats
      })
    }, 300)
  })
}

export function getCategoryClassifyData() {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve({
        code: 200,
        data: mockData.categoryClassifyData
      })
    }, 300)
  })
}

// 工具方法
export function formatLargeNumber(num) {
  if (!num) return 0
  return (num / 10000).toFixed(2)
}

// 图表配置
export const chartConfig = {
  textColor: '#9AA8D4',
  colors: ["#070093", "#1c3fbf", "#1482e5", "#70b4eb", "#b4e0f3", "#ffffff"],
  monthArray: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
} 